<?php

/*    functions.php    */
/*    sun&ride GmbH    */
include "database.php";
function get_page_title($section) {
    $ret = array();
    if ($section == "products") {
        $ret = " - Produkte";
    } else if ($section == "about") {
        $ret = " - &Uumlber Uns";
    } else if ($section == "support") {
        $ret = " - Support";
    } else if ($section == "contact") {
        $ret = " - Kontakt";
    } else if ($section == "home") {
        $ret = " ";
    } else {
        $ret = false;
    }
    return $ret;
}

function get_page_style($section){
    if ($section == "products") {
        $ret = "style_products.css";
    } else if ($section == "about") {
        $ret = "style_about.css";
    } else if ($section == "support") {
        $ret = "style_support.css";
    } else if ($section == "contact") {
        $ret = "style_contact.css";
    } else if ($section == "home") {
        $ret = "style_home.css";
    } else {
        $ret = "style_intro.css";
    }
    return $ret;
}

function get_products(){
    $ret=array();
    $count=mysql_query("SELECT count(*) FROM products");
    for($i=1;$i<=$count;$i=$i+1){
        $ret=mysql_query("SELECT name FROM products WHERE ID=="+$i);
    }
    return $ret;
}

function get_products_count(){
    return mysql_query("SELECT count(*) FROM products");
}

function get_product_name($index){
    mysql_connect('127.0.0.1', 'sunandride', 'sunandridedb')
    or die ("Keine Verbindung möglich. Host nicht erreichbar.");
        
    mysql_select_db('sunridedb')
    or die ("Die Datenbank existiert nicht.");
    
    $ret = mysql_query("SELECT name FROM products WHERE ID=1");
    return $ret;
}
?>
